<?php
	header("Content-type: text/html; charset=utf-8");
	date_default_timezone_set('PRC');
	@session_start();
	$db_server = "localhost";
	$db_user = "root";
	$db_pwd = "root";
	$db_name = "500vip";
	   
	
	$data = $_POST;
	$user = unserialize($_SESSION['member-session-name']);
	$data['uid'] = $user['uid'];
	$data['username'] = $user['uid'];
	$data['add_time'] = time();
	$data['dingji_id'] = $_SESSION['dingji_id'];
	// if ($_FILES['pic']['tmp_name']) {
 //        $pic = $_FILES['pic'];
 //        //对文件进行重命名
 //        $newtime = time().rand(0,999);
 //        $uptype = explode(".",$pic['name']);
 //        $pic['name'] = $newtime.'.'.$uptype[1];
        
 //        $path = 'upload/chongzhi/';
 //        $path .= date('Ymd');

 //        if ($_FILES["pic"]["error"] > 0)
	//     {
	//     echo "Error: " . $_FILES["pic"]["error"] . "<br />";
	//     }
 //        if(!file_exists($path))//文件夹不存在，先生成文件夹
 //        {
 //            mkdir($path,0775,true);
 //            chmod($path,0775);
 //           move_uploaded_file($_FILES["pic"]["tmp_name"],$path."/".$pic['name']);
 //            $data['pic'] = $path."/".$pic['name'];
 //        }else{
 //           move_uploaded_file($_FILES["pic"]["tmp_name"],$path."/".$pic['name']);
 //            $data['pic'] = $path."/".$pic['name'];
 //        }
 //    }

	if (empty($data['names']) || empty($data['bank_hm']) || empty($data['moneys']) || empty($data['beizhu'])) {
		echo "<script>alert('请填写完整内容');history.go(-1);</script>";exit;
	}
	$sql = "insert into ssc_chongzhi (uid,username,names,bank_hm,moneys,beizhu,add_time,dingji_id) values ('{$data['uid']}', '{$data['username']}', '{$data['names']}', '{$data['bank_hm']}', '{$data['moneys']}', '{$data['beizhu']}', '{$data['add_time']}', '{$data['dingji_id']}')";
	// print_r($info);exit;
	$conn = mysqli_connect($db_server, $db_user, $db_pwd);
	$my_db = mysqli_select_db($conn ,$db_name);
	$result = mysqli_query($conn ,$sql);
	if ($result) {
		echo "<script>alert('充值申请成功');history.go(-1);</script>";
		// $this->display('index/index1');
	}
       

?>